﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Fluq
{
	sealed class Dependency : IDependency
	{
		private IDependencyKey _key;
		private Func<IDependencyContainer, IEnumerable<IDependencyParameter>, object> _factory;
		private IDependencyLifestyle _lifestyle;
		private IEnumerable<IDependencyParameter> _parameters;

		public Dependency(IDependencyKey key, Func<IDependencyContainer, IEnumerable<IDependencyParameter>, object> factory, IDependencyLifestyle lifestyle, IEnumerable<IDependencyParameter> parameters)
		{
			_key = key;
			_factory = factory;
			_lifestyle = lifestyle;
			_parameters = parameters;
		}

		public IDependencyKey Key { get { return _key; } }

		public Func<IDependencyContainer, IEnumerable<IDependencyParameter>, object> Factory { get { return _factory; } }

		public IDependencyLifestyle Lifestyle { get { return _lifestyle; } }

		public Action<object> Disposer { get { return instance => { }; } }

		public IEnumerable<IDependencyParameter> Parameters { get { return _parameters; } }
	}
}
